Assignemnt #23 and twentieth Program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: twentieth Program
///File name: TwenProg.java
///Date Finished:9/23/2015
import java.util.Scanner;
public class TwenProg
{
public static void main( String[] args )
{
String firstName, lastName;
int grade, login, ID;
double GPA;
Scanner keyboard = new Scanner(System.in);
System.out.println( "Please enter the following information so i can sell it for a profit!" );
System.out.print( "" );
System.out.print( "First name: " );
firstName = keyboard.next();
System.out.print( "Last name: " );
lastName = keyboard.next();
System.out.print( "Grade (9-12): " );
grade = keyboard.nextInt();
System.out.print( "Student ID: " );
ID = keyboard.nextInt();
System.out.print( "Login: " );
login = keyboard.nextInt();
System.out.print( "GPA (0.0-4.0): " );
GPA = keyboard.nextDouble();
System.out.println( "Your information:" );
System.out.println( "Login: " + login );
System.out.println( "ID: " + ID );
System.out.println( "Name: " + lastName + "," + firstName );
System.out.println( "GPA: " + GPA );
System.out.println( "Grade: " + grade );
}
}
Picture of the output